package javagprssrv.StructClass;

import javagprssrv.JGS_Param;
import javagprssrv.Common.DateTime;
import java.util.Vector;

public class structTask
{
    private int _TaskIDNoLength;
    private java.lang.String TaskHeadString;
    public boolean isScheme;
    public boolean isTCP;
    public boolean isBindIP;
    public java.lang.String BindGPRS_IP;
    public java.lang.String BindGPRS_Port;
    public int TermType;
    public java.lang.String XZQYM;
    public int TaskType;
    public boolean TaskCanBeAsyn;
    public java.lang.String TaskAsynTelNO_ALL;
    public java.lang.String TaskAsynTelNO;
    public java.lang.String Task_ZuBie;
    public java.lang.String Term_SerialNo;
    public java.lang.String Task_TelNo;
    public java.lang.String Task_TermNo;
    public int Task_State;
    public int Task_JobsIndex;
    public java.lang.String Task_Job;
    public java.util.Vector<java.lang.String> Task_OriginJobs;
    public java.util.Vector<java.lang.String> Task_Jobs;
    public java.util.Vector<java.lang.String> Task_JobsRecvDatas;
    public java.lang.String Task_Creater;
    public java.lang.String Task_JobStartDatetime;
    public java.lang.String Task_SchemeDateTime;
    public java.lang.String Task_StartDateTime;
    public java.lang.String Task_EndDateTime;
    public boolean Task_isJSSJ;
    public java.lang.String JSSJ_ClientIP;
    public int JSSJ_ClientPort;
    public java.lang.String _TaskID;
    public java.lang.String _TaskCreateDateTime;
    
    public structTask() {
        this._TaskIDNoLength = 4;
        this.TaskHeadString = "ZT";
        this.Term_SerialNo = "";
        this.Task_TelNo = "";
        this.Task_TermNo = "";
        this.Task_State = 0;
        this.Task_JobsIndex = -1;
        this.Task_Job = "";
        this.Task_OriginJobs = new java.util.Vector<java.lang.String>();
        this.Task_Jobs = new java.util.Vector<java.lang.String>();
        this.Task_JobsRecvDatas = new java.util.Vector<java.lang.String>();
        this.Task_Creater = "";
        this.Task_JobStartDatetime = "";
        this.Task_SchemeDateTime = "";
        this.Task_StartDateTime = "";
        this.Task_EndDateTime = "";
        this.Task_isJSSJ = false;
        this.JSSJ_ClientIP = "";
        this.JSSJ_ClientPort = -1;
        this._TaskID = "";
        this._TaskCreateDateTime = "";
        this._TaskCreateDateTime = new javagprssrv.Common.DateTime().getDateTime("YYYY-MM-DD HH:NN:SS");
        this.AutoCreateTaskID();
    }
    
    private synchronized void AutoCreateTaskID() {
        final java.lang.String datetime = new javagprssrv.Common.DateTime().getDateTime("YYMMDDHHNNSS");
        int index = 0;
        if (datetime.equals(javagprssrv.JGS_Param.TaskDateTime)) {
            ++javagprssrv.JGS_Param.TaskIndex;
            index = javagprssrv.JGS_Param.TaskIndex;
        }
        else {
            javagprssrv.JGS_Param.TaskDateTime = datetime;
            javagprssrv.JGS_Param.TaskIndex = 1;
            index = 1;
        }
        java.lang.String index_str = java.lang.String.valueOf(index);
        for (int indexSize = index_str.length(), i = 0; i < this._TaskIDNoLength - indexSize; ++i) {
            index_str = "0" + index_str;
        }
        this._TaskID = this.TaskHeadString + datetime + "." + index_str;
    }
}
